//package com.wise.service.cms.content.dicttype;//package com.byton.service.cms.dict.dicttype;
//
//import com.alibaba.fastjson.JSON;
//import com.byton.model.demo.demotype.DemoType;
//import com.byton.summer.v1.cms.demo.demotype.*;
//import com.byton.summer.v1.cms.demo.demotypes.AddDemoTypes;
//import com.byton.summer.v1.cms.demo.demotypes.DeleteDemoTypes;
//import com.byton.summer.v1.cms.demo.demotypes.ListDemoTypes;
//import com.byton.summer.v1.cms.demo.demotypes.UpdateDemoTypes;
//import com.wise.framework.daoannotations.SimpleTransactionId;
//import com.wise.framework.daomodel.*;
//import com.wise.framework.logger.Logger;
//import com.wise.framework.restful.PageResultList;
//import com.wise.framework.validation.Precondition;
//import com.wise.framework.web.SysRequestTransactionInit;
//import com.wise.summer.v1.cms.content.dicttype.GetDictTypeByCode;
//import org.joda.time.DateTime;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//import org.summerframework.model.SummerService;
//
//import java.sql.Timestamp;
//import java.util.Objects;
//
//import static com.wise.framework.exception.ErrMsgs.Err_000000000012;
//
//@Service
//@SummerService
//public class AddDictTypeService {
//    private static Logger logger = Logger.getLogger(AddDictTypeService.class);
//
//    @Value("${server.port}")
//    private int serverPort;
//
//    @Autowired
//    private AddDictTypeService addDictTypeService;
//
//    public void sum(GetDictTypeByCode summer) throws InterruptedException {
//        if(Objects.equals("AddDemoType0", summer.getCode())) {
//            an_int = (null == summer.getNum()?0:summer.getNum());
//            new Thread(addDictTypeService::run).start();
//        }
//        if(Objects.equals("AddDemoType1", summer.getCode())) {
//            an_int = (null == summer.getNum()?0:summer.getNum());
//            new Thread(addDictTypeService::run1).start();
//        }
//        if(Objects.equals("AddDemoType", summer.getCode())) {
//
//
//            IncrementUpdate inc = new IncrementUpdate();
//            inc.setTableName("tb_sys_role3");
//            inc.setId("5c1606c0c0dcde91992dffeb");
//            inc.setExtCondation("pcount>=1");
//            inc.addIncValue("pcount", "-1");
//
//            Integer count = DaoIncrement.s(inc);
//            Precondition.checkState(count>0, Err_000000000012);
//
//            AddDemoType addDemoType1 = new AddDemoType();
//            addDemoType1.setAnInt(1);
//            addDemoType1.setAnInt(null == summer.getNum()?0:summer.getNum());
//            addDemoType1.setAnString("anstring");
////            addDemoType1.setTestTime(DateTimeUtil.timestampNow());
//
//            addDemoType1.sum();
//            DemoType summerResult = addDemoType1.getSummerResult();
//            summer.setSummerResult(null==summerResult?"":summerResult.getIconRemark());
//        }
//
//        if(Objects.equals("DeleteDemoTypeById", summer.getCode())) {
//            DeleteDemoTypeById deleteDemoTypeById = new DeleteDemoTypeById();
//            deleteDemoTypeById.setId("typebyid");
//            deleteDemoTypeById.sum();
//        }
//
//        if(Objects.equals("DeleteDemoTypeById2", summer.getCode())) {
//            DeleteDemoTypeById deleteDemoTypeById = new DeleteDemoTypeById();
//            deleteDemoTypeById.sum();
//        }
//
//        if(Objects.equals("DeleteDemoTypeById3", summer.getCode())) {
//            DeleteDemoTypeById deleteDemoTypeById = new DeleteDemoTypeById();
//            deleteDemoTypeById.setId("");
//            deleteDemoTypeById.sum();
//        }
//
//        if(Objects.equals("DeleteDemoTypeByCode", summer.getCode())) {
//            DeleteDemoTypeByCode deleteDemoTypeByCode = new DeleteDemoTypeByCode();
//            deleteDemoTypeByCode.setCode("code");
//            deleteDemoTypeByCode.sum();
//        }
//
//        if(Objects.equals("DeleteDemoTypeByShortCode", summer.getCode())) {
//            DeleteDemoTypeByShortCode deleteDemoTypeByShortCode = new DeleteDemoTypeByShortCode();
//            deleteDemoTypeByShortCode.setShortCode("shotcode");
//            deleteDemoTypeByShortCode.sum();
//        }
//
//
//        if(Objects.equals("GetDemoTypeById", summer.getCode())) {
//            GetDemoTypeById getDemoTypeById = new GetDemoTypeById();
//            getDemoTypeById.setId("byid");
//            getDemoTypeById.setNum(88);
//            getDemoTypeById.sum();
//        }
//
//        if(Objects.equals("GetDemoTypeById2", summer.getCode())) {
//            GetDemoTypeById getDemoTypeById = new GetDemoTypeById();
//            getDemoTypeById.setNum(88);
//            getDemoTypeById.sum();
//        }
//
//        if(Objects.equals("GetDemoTypeById3", summer.getCode())) {
//            GetDemoTypeById getDemoTypeById = new GetDemoTypeById();
//            getDemoTypeById.setId("");
//            getDemoTypeById.setNum(88);
//            getDemoTypeById.sum();
//        }
//
//        if(Objects.equals("GetDemoTypeByCode", summer.getCode())) {
//            GetDemoTypeByCode getDemoTypeByCode = new GetDemoTypeByCode();
//            getDemoTypeByCode.setCode("code");
//            getDemoTypeByCode.setNum(9);
//            getDemoTypeByCode.sum();
//        }
//
//        if(Objects.equals("GetDemoTypeByShortCode", summer.getCode())) {
//            GetDemoTypeByShortCode getDemoTypeByShortCode = new GetDemoTypeByShortCode();
//            getDemoTypeByShortCode.setShortCode("shortcode");
//            getDemoTypeByShortCode.sum();
//        }
//
//
//        if(Objects.equals("UpdateDemoTypeById", summer.getCode())) {
//            UpdateDemoTypeById updateDemoTypeById = new UpdateDemoTypeById();
//            updateDemoTypeById.setAnInt(10);
//            updateDemoTypeById.setAnString("anstr");
//            updateDemoTypeById.setId("byid");
//            updateDemoTypeById.sum();
//        }
//
//        if(Objects.equals("UpdateDemoTypeById2", summer.getCode())) {
//            UpdateDemoTypeById updateDemoTypeById = new UpdateDemoTypeById();
//            updateDemoTypeById.setAnInt(10);
//            updateDemoTypeById.setId("byid");
//            updateDemoTypeById.sum();
//        }
//
//        if(Objects.equals("UpdateDemoTypeById3", summer.getCode())) {
//            UpdateDemoTypeById updateDemoTypeById = new UpdateDemoTypeById();
//            updateDemoTypeById.setAnInt(10);
//            updateDemoTypeById.setAnString("anstr");
//            updateDemoTypeById.setId("");
//            updateDemoTypeById.sum();
//        }
//
//        if(Objects.equals("UpdateDemoTypeByCode", summer.getCode())) {
//            UpdateDemoTypeByCode updateDemoTypeByCode = new UpdateDemoTypeByCode();
//            updateDemoTypeByCode.setCode("code");
//            updateDemoTypeByCode.sum();
//        }
//
//
//        if(Objects.equals("UpdateDemoTypeByShortCode", summer.getCode())) {
//            UpdateDemoTypeByShortCode updateDemoTypeByShortCode = new UpdateDemoTypeByShortCode();
//            updateDemoTypeByShortCode.setShortCode("shortcode");
//            updateDemoTypeByShortCode.sum();
//        }
//
//        if(Objects.equals("", summer.getCode())) {
//        }
//
//
//
//        if(Objects.equals("AddDemoTypes", summer.getCode())) {
//            AddDemoTypes addDemoTypes = new AddDemoTypes();
//            addDemoTypes.setAnInt(78);
//            addDemoTypes.setAnString("8899ddd");
//            addDemoTypes.sum();
//        }
//
//        if(Objects.equals("DeleteDemoTypes", summer.getCode())) {
//            DeleteDemoTypes deleteDemoTypes = new DeleteDemoTypes();
//            deleteDemoTypes.setAnInt(66);
//            deleteDemoTypes.setAnString("mmm");
//            deleteDemoTypes.sum();
//        }
//
//        if(Objects.equals("UpdateDemoTypes", summer.getCode())) {
//            UpdateDemoTypes updateDemoTypes = new UpdateDemoTypes();
//            updateDemoTypes.setAnInt(55);
//            updateDemoTypes.setAnString("wero");
//            updateDemoTypes.sum();
//        }
//
//        if(Objects.equals("ListDemoTypes", summer.getCode())) {
//            ListDemoTypes listDemoTypes = new ListDemoTypes();
//            listDemoTypes.setAnInt(12);
//            listDemoTypes.setAnString("12hh");
//            listDemoTypes.sum();
//        }
//
//        if(true) {
//            return;
//        }
//
//        logger.info("===================================:{}", JSON.toJSONString(summer));
////
////        UploadResources ur = new UploadResources();
////        ur.setGroupId("groupid");
////        ur.setResourceName("resourceName");
////        ur.setPath("path");
////        ur.setResourcePath("respath");
////        ur.setOssId("ossid");
////        ur.setExtentionName("extname");
////        ur.setMimeType("mimetype");
////        ur.setImageHeight(0);
////        ur.setImageWidth(0);
////        Timestamp timestampNow = DateTimeUtil.timestampNow();
////        ur.setCreationDate(timestampNow);
////        ur.setCreatedBy("jerry");
////        ur.setLastUpdateDate(timestampNow);
////        ur.setLastUpdateBy("jerry");
////
////        DaoSave.s(ur);
//
//
//
//////        logger.info(summer.getClass().getName());
//////
////
//////        ResDictType resDictType = new ResDictType();
//////        resDictType.setPcount(100);
//////        DaoSave.s(resDictType);
////
////        IncrementUpdate inc = new IncrementUpdate();
////        inc.setTableName(ResDictType._tableName);
////        inc.setId("5c1606c0c0dcde91992dffeb");
////        inc.setExtCondation(ResDictType._pcount+">=1");
////        inc.addIncValue(ResDictType._pcount, "-1");
////
////        Integer count = DaoIncrement.s(inc);
////        Precondition.checkState(count>0, Err_000000000012);
////
////        DictType entity = new DictType();
////        entity.setCreatedBy(101);
////        entity.setIconRemark("");
////        entity.setTime1(new Timestamp(DateTime.now().getMillis()));
////
////        DaoSave.s(entity);
////
////        DictType s = DaoOne4Update.s(DictType.class, "5c1b547e0dee01454d106f9a", ErrMsgs.Err_000000000014);
////        s.setIconRemark("mmmtt91101");
////        DaoSave.s(s);
////
////        DictType s2 = DaoOne4Update.s(DictType.class, "5c1b53330deed6aada04e22d", ErrMsgs.Err_000000000014);
////        s2.setIconRemark("mmm101");
////        DaoSave.s(s2);
////
////
////        if(Objects.equals("1", summer.getId())){
////            Thread.sleep(30000);
////        }
//
//        AddDemoType addDemoType = new AddDemoType();
//        addDemoType.setAnInt(null == summer.getNum()?0:summer.getNum());
//        addDemoType.setAnString("哈哈哈");
//        addDemoType.sum();
////
//////        if(true) throw new ApplicationException("test");
//
////        DeleteDemoType model = new DeleteDemoType();
////        model.setId("iiiii");
////        Boolean sum = model.sum();
//
////        UpdateDemoType model = new UpdateDemoType();
////        model.setId("mmmmiii8888");
////        model.setAnInt(77);
////        model.setAnString("jj");
////        String sum = model.sum();
//
//
//
//
//        ListDemoTypes model = new ListDemoTypes();
//        model.setPage(2);
//        model.setPerPage(10);
//        model.setAnInt(12);
//        model.setAnString("yyy");
//        PageResultList<DemoType> sum = model.sum();
//
////        com.byton.model.dict.common.DictType dictType = new com.byton.model.dict.common.DictType();
////        dictType.setAnInt(3);
////        dictType.setAnString("dict:"+":"+serverPort);
////        dictType.setAnCookieString("cookie123");
////        summer.setSummerResult(JSON.toJSONString(dictType));
//    }
//
//    private static int an_int = 0;
//    @SysRequestTransactionInit
//    public void run() {
//        IncrementUpdate inc = new IncrementUpdate();
//        inc.setTableName("tb_sys_role3");
//        inc.setId("5c1606c0c0dcde91992dffeb");
//        inc.setExtCondation("pcount>=1");
//        inc.addIncValue("pcount", "-1");
//
//        Integer count = DaoIncrement.s(inc);
//        Precondition.checkState(count>0, Err_000000000012);
//
//        AddDemoType addDemoType1 = new AddDemoType();
//        addDemoType1.setAnInt(an_int);
//        addDemoType1.setAnString("anstring");
//
//        DemoType entity = addDemoType1.sum();
//
//        entity = DaoOne4Update.s(DemoType.class, entity.getId(), Err_000000000012);
//
//        entity.setCreatedBy(DateTime.now().getMillisOfDay());
//
//        DaoSave.s(entity);
//
//        entity = DaoOne4Update.s(DemoType.class, entity.getId(), Err_000000000012);
//
//        entity.setIconRemark("hahaha");
//
//        DaoSave.s(entity);
//
//    }
//    @Transactional
//    @SimpleTransactionId
//    public void run1() {
//        IncrementUpdate inc = new IncrementUpdate();
//        inc.setTableName("tb_sys_role3");
//        inc.setId("5c1606c0c0dcde91992dffeb");
//        inc.setExtCondation("pcount>=1");
//        inc.addIncValue("pcount", "-1");
//
//        Integer count = DaoIncrement.s(inc);
//        Precondition.checkState(count>0, Err_000000000012);
//
//        if(an_int==10) { throw new RuntimeException("test"); }
//
//        DemoType entity = new DemoType();
//        entity.setCreatedBy(100);
//        entity.setIconRemark(an_int+"");
//        entity.setTime1(new Timestamp(DateTime.now().getMillis()));
//
//        DaoSave.s(entity);
//
//        entity = DaoOne4Update.s(DemoType.class, entity.getId(), Err_000000000012);
//
//        entity.setCreatedBy(DateTime.now().getMillisOfDay());
//
//        DaoSave.s(entity);
//
//        entity = DaoOne.s(DemoType.class, entity.getId(), null);
//
//        logger.info("88888888: {}", JSON.toJSONString(entity));
//
//    }
//}
